package org.java.calendar;

import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

import java.text.SimpleDateFormat;
import java.time.Clock;
import java.time.Instant;
import java.util.Calendar;

/**
 * @author Zhang Guangyong
 * @desacription 时间操作类
 * @date 2019年07月19日 16:01
 */
public class CalendarTest {

    public static void main(String[] args) {

        Calendar instance = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        System.out.println(instance.get(Calendar.YEAR));
        System.out.println(instance.get(Calendar.MONTH));
        System.out.println(instance.get(Calendar.DATE));

        instance.set(1996, Calendar.DECEMBER, 20, 0, 0, 0);
        System.out.println(sdf.format(instance.getTime()));


        Clock clock = Clock.systemUTC();



    }

}
